<!DOCTYPE html>
<html>
	<head> 
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css" />
		<link rel="stylesheet" href="js/themes/default/easyui.css" />
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>	
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style>
		body{
			font-size:12px;
		}
		table,
		th,
		td {
			border: 1px solid grey;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}
		
		table td:nth-child(odd) {
			background-color: #f1f1f1;/*#e2e9ea*/
			width:160px;
		}
		table td:nth-child(even) {
			width:300px;
		}
		table tr:nth-child(even) {
			background-color:#ffffff;
		}
		input{
			width:280px;
		}
		
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
	</style>
	<body>
		<div class="">
			<div id="sho"></div>
		<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">
				
				<tbody>
					<tr>
						<th colspan="8">新增一个通道：<span style="color:red">此功能不要轻易尝试，会造成服务器崩溃！</span></th>
					</tr>
					<tr>
						<td>通道标识:</td>
						<td colspan="3">
							<input class="form-control" id="p1" type="text" style="width:280px;"/>
						</td>
						<td>通道编号:</td>
						<td colspan="3">
							<input class="form-control" id="p2" type="text" style="width:280px;"/>
						</td>						
					</tr>
					<tr>
						<td>通道名称:</td>
						<td colspan="3">
							<input class="form-control" id="p3" type="text" style="width:280px;"/>
						</td>
						<td>单笔最大金额:</td>
						<td colspan="3">
							<input class="form-control" id="p4" type="text" style="width:280px;"/>
						</td>			
					</tr>
					<tr>
						<td>单笔最小金额:</td>
						<td colspan="3">
							<input class="form-control" id="p5" type="text" style="width:280px;"/>
						</td>
						<td>子通道名称:</td>
						<td colspan="3">
							<input class="form-control" id="p6" type="text" style="width:280px;"/>
						</td>			
					</tr>
					<tr>					
						<td colspan="8">
								<button id="btn" class="btn btn-danger" style="margin:0 auto;display:block;">点击添加</button>  
						</td>										
					</tr>
				</tbody>
			</table>		
		</div>

		</div>
	</body>
	<script>
		$(function(){
			/*添加一个资源*/
			$('#btn').click(function(){
				var p1 = $("#p1").val();
				var p2 = $("#p2").val();
				var p3 = $("#p3").val();
				var p4 = $("#p4").val();
				var p5 = $("#p5").val();
				var p6 = $('#p6').val();
				$.ajax({
					type:"POST",
					url:window.baseUrl+"user/channel/add",
					async:true,
        			data:{
        				channel_tag:p1,
        				channel_no:p2,
        				name:p3,
        				single_max_limit:p4,
        				single_min_limit:p5,
        				sub_name:p6
        			},
        			dataType:"json",
        			success:function(data){
        				console.log("远程调用数据开始。。。")
        				console.log(data)
        				if(data.resp_code == 00000){
        					$('#sho').text("数据添加成功").fadeIn(3000)
        					$('#sho').text("数据添加成功").fadeOut(3000)	
        					$("#p1").val("");
							$("#p2").val("");
							$("#p3").val("");
							$("#p4").val("");
							$("#p5").val("");
							$('#p6').val("");
        				}else{
        					alert("添加数据失败！")
        				}      				
        			},
        			error:function(data){
        				console.log("调用失败！")
        				console.log(data)
        			}
				})
			})
	
		})
	</script>
</html>



